import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
const store = new Vuex.Store({
	state: {
		token:'',
		userInfo:{},
		remark: '不打包',
		cart: [],
	},
	mutations:{
		SET_TOKEN(state,token){
			state.token = token;
		},
		SET_USERINFO(state,unserInfo){
			state.userInfo = unserInfo;
		},
		SET_REMARK(state, remark) {
			state.remark = remark;
		},
		SET_CART(state, cart) {
			state.cart = cart
		},
		REMOVE_CART(state) {
			state.cart = []
		},
	},
	getters: {
		isLogin: state => Object.keys(state.userInfo).length > 0	,
		//是否登录
	},
	actions:{},
})
export default store